package com.fly.caihong.frag;

import android.view.View;
import android.widget.ImageView;

import com.fly.caihong.R;
import com.fly.caihong.activity.FeedbackActivity;
import com.fly.caihong.activity.SettingActivity;
import com.fly.caihong.base.BaseFragment;
import com.fly.caihong.utils.ActivityUtils;
import com.fly.caihong.utils.GlideUtils;
import com.fly.caihong.utils.StatusBarUtils;

public class MineFragment extends BaseFragment {

    private View mBottomView;
    private View mTvFeedback, mTvSetting;

    @Override
    protected void initView(View view) {
        mBottomView = view.findViewById(R.id.vw_bottom);
        mTvFeedback = view.findViewById(R.id.tv_feedback);
        mTvSetting = view.findViewById(R.id.tv_setting);
        ImageView ivProfile = view.findViewById(R.id.iv_profile);
        GlideUtils.loadCircleAvatar(this, ivProfile, "http://wenwen.soso.com/p/20101022/20101022183451-1117281880.jpg");
    }

    @Override
    public void onHiddenChanged(boolean hidden) {
        if (hidden) {
            StatusBarUtils.setFullScreenLightMode(getActivity());
        } else {
            StatusBarUtils.setTransparentForImageView(getActivity(), mBottomView);
        }
    }

    @Override
    protected void initListener() {
        super.initListener();
        mTvFeedback.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityUtils.startActivity(getActivity(), FeedbackActivity.class);
            }
        });
        mTvSetting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityUtils.startActivity(getActivity(), SettingActivity.class);
            }
        });
    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_mine;
    }

}
